<?php
/*
 +----------------------------------------------------------------------
 + Title        : Index 控制器
 + Author       : Randy_chen
 + Version      : V1.0.0.1
 + Initial-Time : 2020/9/2 21:14
 + Last-time    : 2020/9/2 21:14+ 86187
 + Desc         : Index
 +----------------------------------------------------------------------
*/


namespace app\test\controller;


use randy\queue\connector\Amqp;

class Index {

	//推送队列
	public function index() {
		$amqp = new Amqp();
		$res = $amqp->push('提交订单', 'app\common\job\OrderPayFinish', ['id'   => 111,
		                                                             'name' => 2222
		]);
		dump($res);
		exit;
	}

	//延时队列测试
	public function later() {
		$amqp = new Amqp();
		$res = $amqp->later(10, 1, '2', 3);
		dump($res);
		exit;
	}

	//测试消息恢复
	public function huifu() {
		$amqp = new Amqp();
		$res = $amqp->confirmMsgToSend('0ff97363-5c02-41c7-93b0-c46690a8b91a', 1);
		dump($res);
		exit;
	}

	public function consume() {
		$amqp = new Amqp();
		$res = $amqp->consume();
		dump($res);
		exit;
	}
}